<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <ul>
        <li>111</li>
    </ul>
    <div>div1</div>
    <span>span1</span>
    <script>
        const divObj = document.querySelector("div");
        console.log(divObj.nextSibling);
        console.log(divObj.nextElementSibling);

        console.log(divObj.previousSibling);
        console.log(divObj.previousElementSibling);



    </script>
</body>

</html>